Skip to content

Add vocabulary relating to proposals, intentions and measures. #579

Open
scammo wants to merge 15 commits intofedify-dev:mainfrom
54GradSoftware:main
Open

Add vocabulary relating to proposals, intentions and measures. #579
scammo wants to merge 15 commits intofedify-dev:mainfrom
54GradSoftware:main

Conversation

@scammo
Copy link
Copy Markdown

@scammo scammo commented Feb 21, 2026

Summary

Add vocabulary relating to proposals, intentions and measures according to the docs.

Related issue

Reference the related issue(s) by number, e.g.:

Changes

  • Add vocabulary: "proposals", "intentions" and "measures".

Benefits

Users can now build a federated system based on the first part of FEP-0837: Federated Marketplace (https://codeberg.org/fediverse/fep/src/branch/main/fep/0837/fep-0837.md). This is really interesting for making offered goods or services available for discovery in the Fediverse.

Checklist

  • Did you add a changelog entry to the CHANGES.md?
  • Did you write some relevant docs about this change (if it's a new feature)?
  • Did you run mise test on your machine?

Additional notes

Please note that this is both my first pull request and my first enhancement issue for this project. While I have extensive Mastodon/event experience, I have no prior experience of enhancing federation tooling directly. I am happy to make any necessary changes or additions. Thank you for your work!

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @scammo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the @fedify/vocab package by introducing new vocabulary types crucial for building federated marketplace functionalities. These additions enable users to define and exchange information about proposals, economic intentions, and measurable quantities, laying the groundwork for implementing the first part of the Federated Marketplace FEP-0837. This expands the system's capability to describe and discover offered goods or services across the Fediverse.

Highlights

  • New Vocabulary Classes: Introduced Proposal, Intent, and Measure classes to support economic resource coordination in federated networks.
  • Proposal Class: Added the Proposal class for publishing offers or requests, including properties for purpose, primary intent (publishes), reciprocal intent (reciprocal), and whether it is unit-based.
  • Intent Class: Defined the Intent class to describe economic transactions within a proposal, with properties such as action, resourceConformsTo, resourceQuantity, availableQuantity, and minimumQuantity.
  • Measure Class: Implemented the Measure class for representing quantities with units, featuring hasUnit and hasNumericalValue properties.
  • Changelog Update: Updated the CHANGES.md file to document the addition of these new vocabulary types under @fedify/vocab.
Changelog
  • CHANGES.md
    • Added new entries under @fedify/vocab for the Proposal, Intent, and Measure classes.
    • Included details about the properties of each new class.
  • packages/vocab/src/snapshots/vocab.test.ts.snap
    • Updated snapshots to include Measure objects.
    • Updated snapshots to include Intent objects.
    • Updated snapshots to include Proposal objects.
  • packages/vocab/src/intent.yaml
    • Added the YAML definition for the Intent vocabulary type.
    • Defined properties like action, resourceConformsTo, resourceQuantity, availableQuantity, and minimumQuantity for Intent.
  • packages/vocab/src/measure.yaml
    • Added the YAML definition for the Measure vocabulary type.
    • Defined hasUnit and hasNumericalValue properties for Measure.
  • packages/vocab/src/proposal.yaml
    • Added the YAML definition for the Proposal vocabulary type.
    • Defined properties like purpose, publishes, reciprocal, and unitBased for Proposal.
Activity
  • The author, scammo, has submitted their first pull request and enhancement issue for this project.
  • The author has extensive Mastodon/event experience but is new to federation tooling directly.
  • The author is open to making any necessary changes or additions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@issues-auto-labeler issues-auto-labeler bot added activitypub/interop Interoperability issues component/collections Collections related component/federation Federation object related labels Feb 21, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new vocabulary types for economic resource coordination, specifically Proposal, Intent, and Measure, based on FEP-0837. This is a great addition that will enable building federated marketplace applications with Fedify.

The implementation is well-done, with new YAML definitions for the vocabulary generator and corresponding test snapshot updates. I have a few minor suggestions to improve the changes:

  • In CHANGES.md, please add your name to the changelog entry as per the contribution guidelines and remove an unused reference link.
  • In packages/vocab/src/measure.yaml, the hasNumericalValue property should use a numeric type (xsd:float) instead of xsd:string for better type safety and interoperability.

Thank you for your contribution, especially as a first-time contributor! These changes are valuable to the project.

@dahlia dahlia added the component/vocab Activity Vocabulary related label Feb 21, 2026
scammo and others added 4 commits February 24, 2026 15:15
# Conflicts:
#	CHANGES.md
#	packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap
#	packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap
#	packages/vocab-tools/src/__snapshots__/class.test.ts.snap
@scammo
Copy link
Copy Markdown
Author

scammo commented Feb 26, 2026

FYI: I updated the comments, CHANGES.md and the snapshots to the current version :)

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@scammo
Copy link
Copy Markdown
Author

scammo commented Mar 12, 2026

FYI: I resolved the conversation and I created a new enhencement issue #617

Copy link
Copy Markdown
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, @scammo! This is a solid first step toward FEP-0837 support. I have a few design questions and some formatting issues to address before merging.

@scammo
Copy link
Copy Markdown
Author

scammo commented Apr 3, 2026

@dahlia Thank you for all your suggestions and for your patience regarding this matter. I have done my best to resolve all issues. If you notice anything that needs improving before these changes are merged, please let me know.
Thank you again for your work!

Copy link
Copy Markdown
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. I'm still blocking on a few remaining issues: Proposal needs to preserve inherited Object term mappings in its context, the generated snapshot files currently contain unresolved merge markers and appear to be breaking the snapshot CI, and Measure.hasNumericalValue should now move from xsd:string to xsd:decimal since decimal support landed in #640. Please address the inline comments and then I'll take another look.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

The changes add three new vocabulary types to the @fedify/vocab package: Proposal, Intent, and Measure. New YAML vocabulary definition files specify these types with their properties and metadata. Documentation and changelog entries reference these additions, and test infrastructure is updated to support decimal type values.

Changes

Cohort / File(s) Summary
Documentation & Changelog
CHANGES.md, docs/manual/vocab.md
Changelog entry documenting new Proposal, Intent, and Measure vocabulary classes with their properties. Documentation table updated with mappings for Measure properties (unit, numericalValue).
Vocabulary Definitions
packages/vocab/src/intent.yaml, packages/vocab/src/measure.yaml, packages/vocab/src/proposal.yaml
Three new YAML vocabulary schema files introducing Intent with properties (action, resourceConformsTo, resourceQuantity, availableQuantity, minimumQuantity), Measure with properties (unit, numericalValue), and Proposal extending ActivityStreams Object with properties (purpose, publishes, reciprocal, unitBased).
Test Infrastructure
packages/vocab/src/vocab.test.ts
Updated imports to include parseDecimal and added sample value mapping for XSD decimal type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related issues

  • Issue #578: The PR directly implements the requested addition of Proposal, Intent, and Measure vocabulary types with their full YAML schema definitions and integrated changelog reference.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: adding vocabulary for proposals, intentions, and measures, which aligns with all modified files and the PR's core objective.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the purpose, benefits, related issue, and changes made to add vocabulary for proposals, intentions, and measures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGES.md`:
- Line 23: Change the ATX heading "### `@fedify/vocab`" to the file's setext style
to satisfy markdownlint MD003: replace the line "### `@fedify/vocab`" with a
setext underline version using a dash/equals underline matching the other
headings in CHANGES.md (e.g., "@fedify/vocab" followed by a line of "-" of
similar length) so the heading style matches the project's configured markdown
style.

In `@packages/vocab/src/proposal.yaml`:
- Around line 20-24: Add a regression test that serializes a Proposal containing
embedded Intent and Measure and snapshots the resulting JSON-LD to detect
context-compaction drift; construct a Proposal instance with nested Intent and
Measure values, run it through the same JSON-LD serialization/compaction
entrypoint used by the codebase (e.g., the project’s toJsonLd/compactJsonLd
helper that handles Proposal), and assert the output includes the full context
mappings (action, resourceConformsTo, hasUnit, etc.); name the test clearly
(e.g., "Proposal nested context compaction snapshot") so CI will catch
accidental drift of the duplicated context mappings for Proposal/Intent/Measure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3ee63d70-2c21-42f2-aaed-c985b960284c

📥 Commits

Reviewing files that changed from the base of the PR and between bd60323 and b89d621.

⛔ Files ignored due to path filters (4)
  • packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap is excluded by !**/*.snap
  • packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap is excluded by !**/*.snap
  • packages/vocab-tools/src/__snapshots__/class.test.ts.snap is excluded by !**/*.snap
  • packages/vocab/src/__snapshots__/vocab.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • CHANGES.md
  • docs/manual/vocab.md
  • packages/vocab/src/intent.yaml
  • packages/vocab/src/measure.yaml
  • packages/vocab/src/proposal.yaml
  • packages/vocab/src/vocab.test.ts

@scammo
Copy link
Copy Markdown
Author

scammo commented Apr 3, 2026

@dahlia Thank you again for your suggestions and hard work! The whole topic is more complex than I initially hoped, but I hope the changes I've made are useful. If you think any further improvements are needed, please let me know! :)

@scammo scammo requested a review from dahlia April 3, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub/interop Interoperability issues component/collections Collections related component/federation Federation object related component/vocab Activity Vocabulary related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants